package com.chen.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/v1")
public class V1ServletC extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("Servlet V1 执行了");
        // 通过请求转发来间接访问WEB-INF中受保护的资源
        req.getRequestDispatcher("WEB-INF/view/v1.html").forward(req,resp);
    }
}
